#!/usr/bin/env python3
"""
简化的Flight策略测试
"""

def test_flight_strategy():
    print("🔧 测试Flight策略修复")
    print("=" * 40)
    
    try:
        # 导入Flight策略
        from flight_strategy import init_flight_exchange, get_flight_ohlcv_data
        print("✅ Flight策略模块导入成功")
        
        # 初始化交易所
        print("📡 初始化交易所...")
        exchange = init_flight_exchange(use_demo=True)
        
        if exchange:
            print("✅ 交易所初始化成功")
            
            # 测试数据获取
            print("📊 测试数据获取...")
            data = get_flight_ohlcv_data('BTC/USDT:USDT')
            
            if data:
                print("✅ 数据获取成功")
                print(f"   价格: ${data['price']:,.2f}")
                print(f"   数据量: {len(data['full_data'])}行")
                print("🎉 Flight策略数据获取正常！")
                return True
            else:
                print("❌ 数据获取失败")
                return False
        else:
            print("❌ 交易所初始化失败")
            return False
            
    except Exception as e:
        print(f"❌ 测试失败: {e}")
        import traceback
        traceback.print_exc()
        return False

if __name__ == "__main__":
    success = test_flight_strategy()
    if success:
        print("\n🎉 Flight策略修复验证成功！")
    else:
        print("\n⚠️ Flight策略仍有问题")
